package cn.edu.scau.cmi.dengzejun.chapter08;

public class Check {
	public static void main(String args[]) {
		Machine machine=new Machine();
		Goods apple=new Goods("apple");
		apple.setIsDanger(false);
		Goods explosive =new Goods("TNT");
		explosive.setIsDanger(true);
		try {
			machine.checkBag(apple);
			System.out.println(apple.getName()+"access");
		}
		catch(DangerException e) {
			e.toShow();
			System.out.println(apple.getName()+"not access");
		}
		return;
	}
}
